package org.myblog.myblogserver.dao;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Result {
    private String code;
    private String msg;
    private Object data;
    public void success(String msg, Object data)
    {
        this.code = "200";
        this.msg = msg;
        this.data = data;
    }
    public void server_fail(String msg, Object data)
    {
        this.code = "400";
        this.msg = msg;
        this.data = data;
    }
    public void client_fail(String msg, Object data)
    {
        this.code = "500";
        this.msg = msg;
        this.data = data;
    }
}
